#https://gitee.com/kinegratii/borax/

import requests
from borax.calendars.festivals2 import FestivalLibrary
library = FestivalLibrary.load_builtin()

for ndays, wd, festival in library.list_days_in_countdown(countdown=365):
    ret = f'还有{ndays:>3d}天 {wd} {festival.name}'
    print(ret)

    URL = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ce4804e3-9d04-4fb9-be0d-56ae58067ffb'
    mHeader = {'Content-Type': 'application/json; charset=UTF-8'}
    mBody = {
        "msgtype": "text",
        "text": {
            "content": ret
        }
    }
    # 注意：json=mBody  必须用json
    requests.post(url=URL, json=mBody, headers=mHeader)